<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataGrid id="driedFoodProductListDataGrid"
		styleClass="productListDataGrid" var="productPrice"
		value="#{shoppingCartModel.requiredWeek.driedFoodList}" columns="1"
		style="width:100%">
		<p:column style="width:100%">
			<p:panel style="width:100%;margin:0px;padding:0px">
				<h:panelGrid columns="5" cellpadding="0" cellspacing="0"
					style="width:100%;margin:0px;padding:0px">
					<p:commandLink oncomplete="productInfoDlg.show()"
						update=":dialogForm" ajax="true">
						<f:setPropertyActionListener value="#{productPrice.product}"
							target="#{productController.modelCurrent}" />
						<h:graphicImage library="images"
							value="../#{productPrice.product.icon}64.png"></h:graphicImage>
					</p:commandLink>
					<h:panelGrid columns="1" style="width:100%;float:left">
						<h:inputText value="#{productPrice.product.nameLabel}"
							readonly="true"
							style="width:100%;float:left;text-align:left;border:0px" />
						<h:inputText
							value="#{productPrice.product.specificationDescLabel}"
							readonly="true"
							style="float:left;font-size:0.7em;text-align:left;border:0px" />
						<h:outputText value="#{productPrice.product.shortMessageLabel}"
							rendered="#{productPrice.product.shortMessageLabel!=null}"
							style="float:left;font-size:0.7em;text-align:left;border:0px;color:green"></h:outputText>
					</h:panelGrid>


					<h:panelGrid columns="1">
						<h:panelGrid columns="3" rendered="#{productPrice.isOnSpecial}"
							style="text-decoration:line-through">
							<h:outputText value="#{productPrice.price}">
								<f:convertNumber type="currency" minFractionDigits="2"
									maxFractionDigits="2" currencySymbol="$"></f:convertNumber>
							</h:outputText>
							<h:outputText value="/"></h:outputText>
							<h:outputText value="#{productPrice.product.priceUnitLabel}"></h:outputText>
						</h:panelGrid>
						<h:panelGrid columns="3" style="color:red">
							<h:outputText value="#{productPrice.specialPrice}">
								<f:convertNumber type="currency" minFractionDigits="2"
									maxFractionDigits="2" currencySymbol="$"></f:convertNumber>
							</h:outputText>
							<h:outputText value="/"></h:outputText>
							<h:outputText value="#{productPrice.product.priceUnitLabel}"></h:outputText>
						</h:panelGrid>
					</h:panelGrid>

					<h:panelGrid columns="1">
						<h:outputText value="#{productPrice.product.source.label}"
							style="float:left;font-size:0.8em"></h:outputText>
						<h:graphicImage library="images"
							value="../resources/images/icons/system/organic50.png"
							style="float:left" rendered="#{productPrice.product.isOrganic}"></h:graphicImage>

						<ui:remove>
							<h:outputFormat value=" #{msgs.inStock}"
								style="float:left;font-size:0.8em;color:green"
								rendered="#{shoppingCartModel.isCanConfirm and productPrice.product.isLowInventory}">
								<f:param value="#{productPrice.product.inventory}"></f:param>
								<f:param value="#{productPrice.product.stockUnitLabel}"></f:param>
							</h:outputFormat>
						</ui:remove>

					</h:panelGrid>
					<h:panelGrid columns="1" style="width:100%">
						<p:spinner size="1" value="#{productPrice.product.quantity}"
							suffix="#{productPrice.product.stockUnitLabel}" stepFactor="1"
							min="1" style="float:right">
						</p:spinner>
						<p:commandButton value="#{msgs.buy}"
							rendered="#{shoppingCartModel.isCanConfirm}"
							disabled="#{productPrice.product.isOutOfStock}"
							actionListener="#{shoppingCartModel.add}"
							update=":rightForm,:headerForm"
							style="background:green; color:white;width:68px;float:right">
							<f:setPropertyActionListener value="#{productPrice}"
								target="#{shoppingCartModel.add}" />
						</p:commandButton>

						<p:commandButton value="#{msgs.order}"
							rendered="#{!shoppingCartModel.isCanConfirm}"
							actionListener="#{shoppingCartModel.add}"
							update=":rightForm,:headerForm"
							style="background:green; color:white;width:68px;float:right">
							<f:setPropertyActionListener value="#{productPrice}"
								target="#{shoppingCartModel.add}" />
						</p:commandButton>
					</h:panelGrid>
				</h:panelGrid>
			</p:panel>
		</p:column>
	</p:dataGrid>

</ui:composition>
</html>